package com.example.speeddating.controller;

import com.example.speeddating.common.BaseResponse;
import com.example.speeddating.common.RespGenerator;
import com.example.speeddating.entity.Profession;
import com.example.speeddating.service.ProfessionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *
 * @author tina
 * @since 2023-06-28 11:14:33
 */
@RestController
@RequestMapping("/profession")
public class ProfessionController {

    @Autowired
   private ProfessionService professionService;

    /**
     * 查询所有职业
     * @return
     */
   @GetMapping("/all")
   public BaseResponse<List> getAllProfession() {
       List<Profession> list = professionService.list();
       return RespGenerator.returnOK(list);
   }
}
